//连接数据库
const mongoose = require('mongoose');
const dbURI = 'mongodb://localhost:27017/test';

mongoose.connect(dbURI,{useNewUrlParser: true, useUnifiedTopology:true});
mongoose.connection.on('connected', function() {
    console.log(`Mongoose 连接到 ${dbURI}`);
});